<!doctype html>
<html>
	<head>
		<title>Shark Viewer</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<script src="js/threejs/three.min.js"></script>
		<script src="js/threejs/TrackballControls.js"></script>
		<script src="./js/sharkviewer_loader.js"></script>

</script>
</head>
<body>
	<!-- three.js container -->
    	<div id="container" style="position:relative"></div>
	<!-- info on screen display -->


	<script type="text/javascript">
	window.onload = function() {
		var stats, scene, renderer;
		var camera, fov;
		if( !init() )	animate();

		// init the scene
		function init(){
			renderer = new THREE.WebGLRenderer({
				antialias		: true,
			});
			renderer.setClearColorHex( 0xffffff, 1 );
			renderer.setSize( window.innerWidth, window.innerHeight );
			document.getElementById('container').appendChild(renderer.domElement);

			// create a scene
			scene = new THREE.Scene();

			// put a camera in the scene
			fov = 45;
			camera = new THREE.PerspectiveCamera(fov, window.innerWidth / window.innerHeight, 1, 100000);
			camera.position.set(0, 0, 5);
			scene.add(camera);
			controls = new THREE.TrackballControls(camera, renderer.domElement);
		}

		// animation loop
		function animate() {
			requestAnimationFrame( animate );
			controls.update();
			render();

		}

		// render the scene
		function render() {
			// actually render the scene
			renderer.render( scene, camera );
		}
		var L = new THREE.SWCLoader;
		//SWCLoader.load(filename, [mode : sphere, particle, or skeleton], onLoadCallback)
		L.load('swc/test.swc', 'skeleton', fov, window.innerHeight, renderer.devicePixelRatio, function(data) {
			scene.add(data);
			render();
		});
	}

	</script>
</body>
</html>

